package com.zabra.zl.utils;

import com.google.gson.Gson;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import okhttp3.MediaType;
import okhttp3.RequestBody;

public class MaptoJsonUtils {
    public static RequestBody Simple(List<String> keylist, List<String> valulist) {
        Map<String, String> map = new HashMap<>();
        for (int i = 0; i < keylist.size(); i++) {
            map.put(keylist.get(i), valulist.get(i));
        }
        Gson gson = new Gson();
        String jsonStr = gson.toJson(map);
        RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonStr);
        return requestBody;
    }
}
